package com.xiaoge.service;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.InstantiationAwareBeanPostProcessor;
import org.springframework.stereotype.Component;

/**
 * {@Like AbstractAutowireCapableBeanFactory类.resolveBeforeInstantiation方法.applyBeanPostProcessorsBeforeInstantiation}
 * TODO 通过这个接口可以自己实现ioc逻辑, spring会先从我们实现的这个接口中找, 找到是null/没找到为null就会去spring ioc找
 *
 * @author <a href="mailto:1330137071@qq.com">Zhang Xiao</a>
 * @since
 */
@Component
public class XiaogeInstantiationAwareBeanPostProcessor implements InstantiationAwareBeanPostProcessor {

	@Override
	public Object postProcessBeforeInstantiation(Class<?> beanClass, String beanName) throws BeansException {
//		return new Student();
		return null;
	}
}
